{% extends 'base.html' %}
{% load staticfiles %}
{% load codalab_tags %}
{% load tz %}
{% load static %}

{% block head_title %}Edit Team{% endblock head_title %}
{% block page_title %}Edit Team{% endblock page_title %}

{% block extra_headers %}
{# include extra JS stuff here #}
    {{ form.media }}
{% endblock extra_headers %}
{% block extra_scripts %}
    <link rel="stylesheet" href="{% static "teams/teams.css" %}">
    <script type="text/javascript" src="{% static "teams/teams.js" %}"></script>
{% endblock extra_scripts %}

{% block content %}
    <div class="container-fluid">
        <div class="row">
            <div class="col-lg-12">
                <span>
                  <h2>{{ competition.title }}</h2>
                </span>
            </div>
        </div>
    </div>
<form action="" data-abide enctype="multipart/form-data" method="POST">{% csrf_token %}
    {% if errors %}
        <div class="alert alert-error">
            There were errors processing the form, please try reloading the page!
        </div>
    {% endif %}

    {% if saved_successfully %}
        <div class="alert alert-success">
            Saved successfully!
        </div>
    {% endif %}

    {% if form.errors %}
        <div class="alert alert-error">
            {% for field, msg in form.errors.items %}
                <b>{{ field }}</b> {{ msg }}
            {% endfor %}
        </div>
    {% endif %}
    <h3><b>Team Information</b></h3>
    <div class="row">
        <div class="col-sm-12">
            {{ form.non_field_errors }}

            <table id="teams-edit" class="table table-striped affiliation">
                {{ form.as_table }}
            </table>
        </div>
    </div>

    <hr />
    <div class="row">
        <div class="col-sm-4 col-sm-offset-4">
            <button type="submit" class="medium button blue btn btn-primary btn-block">Submit</button>
        </div>
    </div>
</form>
{% endblock content %}

{% block jsincludes %}
    <script src="{% static "js/vendor/django-formset.js" %}"></script>
    <script src="{% static "js/vendor/jquery.datetimepicker.js" %}"></script>
{% endblock jsincludes %}

{% block js %}

{% endblock js %}
